import request from '@/utils/request';

export function listAttendant(query) {
  return request({
    url: '/system/attendant/list',
    method: 'get',
    params: query
  });
}

export function getAttendantUpdateInfo(id) {
  return request({
    url: '/system/attendant/updateInfo/' + id,
    method: 'get'
  });
}

export function getAttendant(id) {
  return request({
    url: '/system/attendant/' + id,
    method: 'get'
  });
}

export function getAttendantRecentOrders(id) {
  return request({
    url: '/system/attendant/getRecentOrders/' + id,
    method: 'get'
  });
}

export function updateAttendant(data) {
  return request({
    url: '/system/attendant',
    method: 'put',
    data: data
  });
}

export function deleteAttendant(id) {
  return request({
    url: '/system/attendant/' + id,
    method: 'delete'
  });
}

// 启用或禁用陪诊师账号
export function changeAttendantStatus(id, status) {
  return request({
    url: '/system/attendant/' + id + '/enableOrDisable/' + status,
    method: 'put',
  });
}